<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Flow Designer</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
    <link rel="stylesheet" href="css/style.css">
    <link rel="stylesheet" href="css/fix.css">

</head>

<body>
    <div class="container">
        <!-- 左侧工具栏 -->
        <div class="sidebar">
            <div class="sidebar-header">
                <h3>流程节点</h3>
            </div>
            <div class="node-list">
                <div class="node-category">
                    <div class="category-title">基础节点</div>
                    <div class="node-item" draggable="true" data-node-type="start">
                        <div class="node-icon">
                            <i class="fas fa-play-circle"></i>
                        </div>
                        <div class="node-text">
                            <span class="node-title">开始节点</span>
                            <span class="node-desc">流程的起始点</span>
                        </div>
                    </div>
                    <div class="node-item" draggable="true" data-node-type="end">
                        <div class="node-icon">
                            <i class="fas fa-stop-circle"></i>
                        </div>
                        <div class="node-text">
                            <span class="node-title">结果节点</span>
                            <span class="node-desc">流程的终止点</span>
                        </div>
                    </div>
                </div>

                <div class="node-category">
                    <div class="category-title">智能节点</div>
                    <div class="node-item" draggable="true" data-node-type="model">
                        <div class="node-icon">
                            <i class="fas fa-brain"></i>
                        </div>
                        <div class="node-text">
                            <span class="node-title">大模型节点</span>
                            <span class="node-desc">AI大模型处理</span>
                        </div>
                    </div>
                    <div class="node-item" draggable="true" data-node-type="agent">
                        <div class="node-icon">
                            <i class="fas fa-robot"></i>
                        </div>
                        <div class="node-text">
                            <span class="node-title">智能体节点</span>
                            <span class="node-desc">具备工具调用能力</span>
                        </div>
                    </div>
                </div>

                <div class="node-category">
                    <div class="category-title">逻辑节点</div>
                    <div class="node-item" draggable="true" data-node-type="ifelse">
                        <div class="node-icon">
                            <i class="fas fa-code-branch"></i>
                        </div>
                        <div class="node-text">
                            <span class="node-title">条件判断节点</span>
                            <span class="node-desc">IF/ELSE条件分支</span>
                        </div>
                    </div>
                    <div class="node-item" draggable="true" data-node-type="iterator">
                        <div class="node-icon">
                            <i class="fas fa-redo"></i>
                        </div>
                        <div class="node-text">
                            <span class="node-title">迭代器节点</span>
                            <span class="node-desc">循环处理数据</span>
                        </div>
                    </div>
                    <div class="node-item" draggable="true" data-node-type="code">
                        <div class="node-icon">
                            <i class="fas fa-code"></i>
                        </div>
                        <div class="node-text">
                            <span class="node-title">代码节点</span>
                            <span class="node-desc">执行Python代码</span>
                        </div>
                    </div>
                </div>

                <div class="node-category">
                    <div class="category-title">工具节点</div>
                    <div class="node-item" draggable="true" data-node-type="template">
                        <div class="node-icon">
                            <i class="fas fa-file-alt"></i>
                        </div>
                        <div class="node-text">
                            <span class="node-title">模板转换节点</span>
                            <span class="node-desc">格式化输出内容</span>
                        </div>
                    </div>
                    <div class="node-item" draggable="true" data-node-type="http">
                        <div class="node-icon">
                            <i class="fas fa-globe"></i>
                        </div>
                        <div class="node-text">
                            <span class="node-title">HTTP节点</span>
                            <span class="node-desc">发送HTTP请求</span>
                        </div>
                    </div>
                    <div class="node-item" draggable="true" data-node-type="database">
                        <div class="node-icon">
                            <i class="fas fa-database"></i>
                        </div>
                        <div class="node-text">
                            <span class="node-title">数据库节点</span>
                            <span class="node-desc">数据库操作</span>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <!-- 中间画布区域 -->
        <div class="canvas-container">
            <div class="canvas" id="flowCanvas">
                <!-- 节点将被动态添加到这里 -->
            </div>
            <div class="canvas-controls">
                <div class="control-group">
                    <button class="control-btn pointer active" title="指针模式"><i
                            class="fas fa-mouse-pointer"></i></button>

                    <button class="control-btn hand" title="手模式"><i class="fas fa-hand-paper"></i></button>

                </div>
                <div class="control-group">
                    <button class="control-btn zoom-in" title="放大"><i class="fas fa-search-plus"></i></button>
                    <button class="control-btn zoom-out" title="缩小"><i class="fas fa-search-minus"></i></button>
                    <button class="control-btn zoom-fit" title="适应画布"><i class="fas fa-expand-arrows-alt"></i></button>
                    <button class="control-btn zoom-lock" title="锁定缩放"><i class="fas fa-lock-open"></i></button>
                    <button class="control-btn center-nodes" title="居中节点"><i
                            class="fas fa-compress-arrows-alt"></i></button>
                </div>
            </div>
            <div class="minimap" id="flowMinimap">
                <div class="minimap-viewport"></div>
            </div>
        </div>

    </div>

    <script src="https://cdnjs.cloudflare.com/ajax/libs/jsPlumb/2.15.6/js/jsplumb.min.js"></script>
    <script src="js/nodes.js"></script>
    <script src="js/flowChart.js"></script>
    <script src="js/main.js"></script>
</body>

</html>